import { NEWS_SAVE_LIST } from '../action/actionTypes';

const initialState = {
  newsList: [],
};

const newsReducer = (state = initialState, { type, payload }) => {
  switch (type) {
    // 3. reducer完成计算
    case NEWS_SAVE_LIST:
      return { ...state, newsList: payload };

    default:
      return state;
  }
};

export default newsReducer;
